<?
	$rad_tour_type 			= "0";
	$sbo_tour_departure 	= "0";
	$sbo_tour_destination 	= "0";
	$sbo_tour_price 		= "0";
	$txt_tour_start_date	= "";
	
if (isset($_SESSION['tour_search_fields']))
{
	$tour_search_fields 	= $_SESSION['tour_search_fields'];
	
	$rad_tour_type 			= $tour_search_fields['tour_type'];
	$sbo_tour_departure 	= $tour_search_fields['tour_departure'];
	$sbo_tour_destination 	= $tour_search_fields['tour_destination'];
	$sbo_tour_price 		= $tour_search_fields['tour_price'];
	$txt_tour_start_date	= $tour_search_fields['tour_start_date'];
}
?>
<form action='/tour-search/du-lich-da-nang.html' method="post">
	<input type='hidden' name='func' value='search'>
    <table cellpadding="0" cellspacing="0" width="400" border="0" class='tbl_transform tbl_search'>
        <tr>
            <td width="200" colspan="2">
                <div style='float:left'><input type='radio' name='rad_tour_type' class='search_rad' id='rad_tour_type_1' <?=($rad_tour_type <= 1)?"checked='checked'":""?> value='1' /></div>
                <div style='float:left;padding:2px 0px 0 5px'>Tour trong nước</div>
            </td>
            <td width="200" colspan="2">
                <div style='float:left'><input type='radio' name='rad_tour_type' class='search_rad' id='rad_tour_type_2' <?=($rad_tour_type == 2)?"checked='checked'":""?> value='2' /></div>
                <div style='float:left;padding:2px 0px 0 5px'>Tour nước ngoài</div>
            </td>
        </tr>
        <tr>
            <td width="50">
                <div class='search_lbl'>Nơi đi</div>
            </td>
            <td>
                <select name='sbo_tour_departure' id='sbo_tour_departure' style='width:110px'>
                <?
					$locations = Location::getAllLocations();
					foreach ($locations as $location)
					{
					?>
                    	<option <?=($location->getid()==$sbo_tour_departure)?"selected='selected'":""?> value="<?=$location->getid()?>"><?=$location->getname()?></option>
					<?	
					}
                ?>
                </select>
            </td>
            <td width="50">
                <div class='search_lbl'>Nơi đến</div>
            </td>
            <td>
                <select name='sbo_tour_destination' id='sbo_tour_destination' style='width:110px'>
                <?
					$locations = Location::getAllLocations();
					foreach ($locations as $location)
					{
					?>
                    	<option <?=($location->getid()==$sbo_tour_destination)?"selected='selected'":""?> value="<?=$location->getid()?>"><?=$location->getname()?></option>
					<?	
					}
                ?>
                </select>
            </td>
        </tr>
        
        <tr>
            <td width="50">
                <div class='search_lbl'>Giá</div>
            </td>
            <td>
                <select name='sbo_tour_price' id='sbo_tour_price'  style='width:110px'>
                	<option value='0' <?=($sbo_tour_price == 0)?"selected='selected'":""?>>Bất kỳ</option>
                    <?
					$prices = PriceSection::getAllPriceSections();
					foreach ($prices as $price)
					{
					?>
                    <option value="<?=$price->getid()?>" <?=($sbo_tour_price == $price->getid())?"selected='selected'":""?>><?=$price->getname()?></option>
                    <?
					}
					?>
                </select>
            </td>
            <td width="50">
                <div class='search_lbl'>Ngày đi</div>
            </td>
            <td>
                <input type='text' id='txt_tour_start_date' name='txt_tour_start_date' class='search_txt date_picker' style='width:90px;float:left;' value="<?=($txt_tour_start_date)?>" /> 
                <img src='/images/icons/date.png' style='cursor:pointer;padding-left:9px;' align="left" onclick="$('.txt_tour_start_date').focus()" />
            </td>
        </tr>
        
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td>
                <input type='submit' value='Tìm kiếm' class='search_btn' />
            </td>
        </tr>
    </table>
</form>